﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UFIDA.U9.CusDev.AITPlugInBP;

namespace UFIDA.U9.CusDev.AITPlugInBE
{
    internal class BatchApproveBPExtend : UFSoft.UBF.Service.BPSVExtendBase
    {
        //配置节点手工拷贝到portal/UBFConfig/UFIDA.UBF.BPSVExtend.config下，
        //dll文件放置到portal/ApplicationServer/Libs下

        //配置节点配置的是登录的BP插件，BeforeDo中参数可以转成成BP的传入参数，修改参数的值
        public override void BeforeDo(object bp)
        {
            #region 获取相关强类型数据
            UFIDA.U9.Approval.Operations.BatchApproveBP strongBP = bp as UFIDA.U9.Approval.Operations.BatchApproveBP;
            if (strongBP == null)
                return;
            #endregion
            //Approval.Operations.BatchApproveActionDTO batchApproveActionDTO = strongBP.ApproveActions[0];
            LogUtils.JsonLog(strongBP.ApproveActions);
        }

        //AfterDo中可以修改BP返回参数值
        public override void AfterDo(object bp, ref object result)
        {
            #region 获取相关强类型数据
            //参数BP为传入的参数
            UFIDA.U9.Approval.Operations.BatchApproveBP strongBP = bp as UFIDA.U9.Approval.Operations.BatchApproveBP;
            if (strongBP == null)
                return;
            //参数result为接口返回的参数
            LogUtils.JsonLog(result);
            #endregion

        }
        
    }
}
